DROP TABLE IF EXISTS jms_ods.yl_lmdm_sys_network;
CREATE EXTERNAL TABLE jms_ods.yl_lmdm_sys_network(
 ID bigint comment "主键ID",  --NUMBER(11)
 NAME string comment "名称",  --NVARCHAR2(60)
 CODE string comment "编号",  --NVARCHAR2(30)
 SIGNATURE_CODE string comment "特征码",  --NVARCHAR2(30)
 CN_NAME string comment "中文名称",  --NVARCHAR2(60)
 EN_NAME string comment "英文名称",  --NVARCHAR2(60)
 COUNTRY_ID bigint comment "所属国家",  --NUMBER(11)
 COUNTRY_CODE string comment "所属国家编码",  --NVARCHAR2(30)
 COUNTRY_DESC string comment "所属国家名称",  --NVARCHAR2(60)
 COUNTRY_THREE_CODE string comment "所属国家三字码",  --NVARCHAR2(60)
 REGIONAL_ID bigint comment "大区ID",  --NUMBER(11)
 REGIONAL_DESC string comment "大区名称",  --NVARCHAR2(60)
 AREA_INFO_ID bigint comment "片区ID",  --NUMBER(11)
 AREA_INFO_DESC string comment "片区名称",  --NVARCHAR2(60)
 PROVIDER_ID bigint comment "省份ID",  --NUMBER(11)
 PROVIDER_DESC string comment "省份",  --NVARCHAR2(60)
 CITY_ID bigint comment "城市ID",  --NUMBER(11)
 CITY_DESC string comment "城市",  --NVARCHAR2(60)
 AREA_ID bigint comment "区/县ID",  --NUMBER(11)
 AREA_DESC string comment "区/县",  --NVARCHAR2(60)
 PRINCIPAL string comment "负责人",  --NVARCHAR2(50)
 MOBILE string comment "手机号码",  --NVARCHAR2(20)
 TELEPHONE string comment "座机号",  --NVARCHAR2(20)
 PARENT_NETWORK_ID bigint comment "所属网点ID",  --NUMBER(11)
 PARENT_NETWORK_CODE string comment "所属网点编码",  --NVARCHAR2(30)
 PARENT_NETWORK_NAME string comment "所属网点名称",  --NVARCHAR2(50)
 FINANCIAL_CENTER_ID bigint comment "财务中心ID",  --NUMBER(11)
 FINANCIAL_CENTER_CODE string comment "财务中心CODE",  --NVARCHAR2(30)
 FINANCIAL_CENTER_DESC string comment "财务中心名称",  --NVARCHAR2(60)
 FUNCTION_TYPE_ID bigint comment "功能类型ID",  --NUMBER(11)
 FUNCTION_TYPE_DESC string comment "功能类型描述",  --NVARCHAR2(60)
 TYPE_ID bigint comment "网点类型ID",  --NUMBER(11)
 TYPE_DESC string comment "网点类型描述",  --NVARCHAR2(60)
 INSTITUTIONAL_LEVEL_ID bigint comment "机构级别",  --NUMBER(11)
 INSTITUTIONAL_LEVEL_DESC string comment "机构级别描述",  --NVARCHAR2(60)
 MAX_COLLECTION_MONEY bigint comment "代收货款上限",  --NUMBER(20)
 SETTLEMENT_DESTINATION_ID bigint comment "结算目的地ID",  --NUMBER(11)
 SETTLEMENT_DESTINATION_DESC string comment "结算目的地描述",  --NVARCHAR2(60)
 IS_COLLECTION_IDENTIFIER int comment "代收货款标识:1是,2否",  --NUMBER(6)
 IS_DISTRIBUTION_CENTER int comment "是否分拨中心标识:1是,2否",  --NUMBER(6)
 BUSINESS_MODEL_ID int comment "经营方式",  --NUMBER(6)
 BUSINESS_MODEL_DESC string comment "经营方式描述",  --NVARCHAR2(60)
 LOCAL_CURRENCY_ID int comment "本币币别",  --NUMBER(6)
 LOCAL_CURRENCY_CODE string comment "本币币别编码",  --NVARCHAR2(30)
 LOCAL_CURRENCY_DESC string comment "本币币别描述",  --NVARCHAR2(60)
 IS_FINANCIAL_CENTER int comment "财务中心标识:1是,2否",  --NUMBER(6)
 IS_WAYBILL_IDENTIFICATION int comment "运单发放标识:1是,2否",  --NUMBER(6)
 IS_TO_PAYMENT int comment "到付款标识:1是,2否",  --NUMBER(6)
 IS_VISIBILITY int comment "是否对外显示 1是 2否",  --NUMBER(6)
 IS_ENABLE int comment "是否启用:1启用,2不启用",  --NUMBER(6)
 IS_LEAF int comment "是否叶子节点:1是,2否",  --NUMBER(6)
 IS_DELETE int comment "是否删除:1未删除,2已删除",  --NUMBER(6)
 ADDRESS string comment "详细地址",  --NVARCHAR2(500)
 BUSINESS_PRINCIPAL string comment "业务负责人",  --NVARCHAR2(60)
 BUSINESS_TELEPHONE string comment "业务电话",  --NVARCHAR2(60)
 CUSTOMER_SERVICE_PRINCIPAL string comment "客服负责人",  --NVARCHAR2(60)
 CUSTOMER_SERVICE_TELEPHONE string comment "客服电话",  --NVARCHAR2(500)
 LONGITUDE string comment "经度",  --NVARCHAR2(50)
 LATITUDE string comment "纬度",  --NVARCHAR2(50)
 CREATE_BY bigint comment "创建人ID",  --NUMBER(11)
 UPDATE_BY bigint comment "最后更新人ID",  --NUMBER(11)
 CREATE_BY_NAME string comment "创建人名称",  --NVARCHAR2(50)
 UPDATE_BY_NAME string comment "最后修改人名称",  --NVARCHAR2(50)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 UPDATE_TIME timestamp comment "更新时间",  --DATE
 VERSION string comment "版本号",  --NVARCHAR2(10)
 SORT int comment "排序",  --NUMBER(6)
 REMARK string comment "",  --NVARCHAR2(2000)
 PATH string comment "树路径",  --NVARCHAR2(255)
 IS_RECEIVING int comment "是否有收货电子围栏:1是,2否",  --NUMBER(6)
 IS_DISPATCH int comment "是否有派货电子围栏:1是,2否",  --NUMBER(6)
 ZIP_CODE string comment "邮编",  --NVARCHAR2(20)
 START_BUSINESS_TIME timestamp comment "开始营业时间",  --DATE
 END_BUSINESS_TIME timestamp comment "结束营业时间",  --DATE
 LAST_UPDATE_TIME_SYNC timestamp comment "同步时间戳-",  --DATE
 COORDINATE string comment "网点经纬度",  --NVARCHAR2(255)
 SUBORDINATE_AGENT string comment "所属代理",  --NVARCHAR2(50)
 IS_FIRST_NETWORK_SETTLE int comment "是否一级网点结算标识,1:是,2:否",  --NUMBER(6)
 SIMPLE_NAME string comment "简称",  --NVARCHAR2(255)
 IS_FIRST_FRANCHISEE int comment "是否一级加盟商 1是 2否",  --NUMBER(6)
 IS_SECOND_FRANCHISEE int comment "是否二级加盟商 1是 2否",  --NUMBER(6)
 IS_ENTREPOT int comment "是否集散",  --NUMBER(6)
 TOWNSHIP_ID bigint comment "乡镇ID",  --NUMBER(11)
 TO_PAYMENT_LIMIT bigint comment "到付款限额",  --NUMBER(11)
 OPENING_TYPE smallint comment "开通类型:1-新开通 2-合并开通 3-转让开通，4-拆分开通",  --NUMBER(4)
 OPENING_TIME timestamp comment "开通时间",  --DATE
 IS_RETROGRESSION tinyint comment "是否退转网点 1是 2否 默认（2-否）",  --NUMBER(2)
 IS_SUSPEND tinyint comment "是否暂停(1是,2否)默认2-否",  --NUMBER(2)
 LEAVING_TIME timestamp comment "暂停时间",  --DATE
 COMPANY string comment "所属公司",  --NVARCHAR2(50)
 BUSI_LICENSE_URL string comment "营业执照"  --NVARCHAR2(200)
 )
 COMMENT '网点资料'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_ods.db/external/yl_lmdm_sys_network'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );

MSCK REPAIR TABLE jms_ods.yl_lmdm_sys_network;